import {reactive} from "vue";
import http from "../http";
const healthInfo = reactive({
    id: 0,
    health_info: {},
    get_health_info_by_id(){
        // 获取疾病分类信息
        return http.get(`/health/gethealthInfo/${this.id}/`,).then(response=>{
            // console.log('疾病分类详细信息请求成功..........');
            // console.log(response);
            this.health_info = response.data;
        }).catch((err) => {
            console.log('疾病分类详细信息请求失败------');
            console.log(err);
        });
    },
    get_life_info_by_id(){
        // 获取生活手册-生活技巧信息
        return http.get(`/health/getlifeInfo/${this.id}/`,).then(response=>{
            // console.log('生活技巧详细信息请求成功..........');
            // console.log(response);
            this.health_info = response.data;
        }).catch((err) => {
            console.log('生活技巧详细信息请求失败------');
            console.log(err);
        });
    },


})

export default healthInfo;